import {Controller, Render, Get, Session, Req, Res, UseBefore} from "routing-controllers";
import { utils } from "../../utils/utils";
import { CheckLoginMiddleware } from "../../middleware/CheckLoginMiddleware";

@Controller()
//@UseBefore(CheckLoginMiddleware)
export class UserActionControllerHome {
  @Get("/reg")
  @Render("home/page/reg")
  public async reg(@Session() session,@Res() res: any,) {
    if (!session || !session.user) {
      return {
        title: utils.titleName("注册 & 登录"),
        isShowAction: {
          header: false,
          footer: false
        },
        banner: {
          bannerTitle: '注册',
          bannerUrl: '/img/banner.png',
        }
      }
    }else {
      res.redirect('/error')
      return res;
    }
   
  }
}